home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoZoomAction.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  2.4 KB  |  83 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 2004 Ariya Hidayat <ariya@kde.org>
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License version 2 as published by the Free Software Foundation.
  7.  
  8.     This library is distributed in the hope that it will be useful,
  9.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.     Library General Public License for more details.
  12.  
  13.     You should have received a copy of the GNU Library General Public License
  14.     along with this library; see the file COPYING.LIB.  If not, write to
  15.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.  * Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef kozoomaction_h
  20. #define kozoomaction_h
  21.  
  22. #include <kaction.h>
  23. #include <koffice_export.h>
  24. /**
  25.  * Class KoZoomAction implements an action to provide zoom values.
  26.  * In a toolbar, KoZoomAction will show a dropdown list, also with 
  27.  * the possibility for the user to enter arbritrary zoom value
  28.  * (must be an integer). The values shown on the list are alwalys
  29.  * sorted.
  30.  */
  31. class KOFFICEUI_EXPORT KoZoomAction : public KSelectAction
  32. {
  33. Q_OBJECT
  34.  
  35. public:
  36.  
  37.   /**
  38.    * Creates a new zoom action.
  39.    */
  40.   KoZoomAction( const QString& text, const QIconSet& pix, 
  41.     const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 );
  42.       
  43.   /**
  44.    * Creates a new zoom action.
  45.    */
  46.   KoZoomAction( const QString& text, const QString& pix, 
  47.     const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 );
  48.       
  49. public slots:
  50.  
  51.   /**
  52.    * Sets the zoom. If it's not yet on the list of zoom values, it will be inserted
  53.    * into the list at proper place so that the the values remain sorted.
  54.    */
  55.   void setZoom( const QString& zoom );
  56.   
  57.   /**
  58.    * Sets the zoom. If it's not yet on the list of zoom values, it will be inserted
  59.    * into the list at proper place so that the the values remain sorted.
  60.    */
  61.   void setZoom( int zoom );
  62.  
  63. protected slots:
  64.  
  65.   void activated( const QString& text );  
  66.   
  67. signals:
  68.  
  69.   /**
  70.    * Signal zoomChanged is triggered when user changes the zoom value, either by
  71.    * choosing it from the list or by entering new value.
  72.    */
  73.   void zoomChanged( const QString& zoom );
  74.   
  75. protected:
  76.  
  77.   void init();
  78.   
  79. };
  80.  
  81.  
  82. #endif // kozoomaction_h
  83.